package cerebrum.entity;

import java.util.concurrent.LinkedBlockingDeque;

/**
 * 自定义队列容器，鼠标键盘操作时，监听任务就往此队列中添加数据
 *
 * @param <E>
 */
public class MyLinkedBlockingDeque<E> extends LinkedBlockingDeque<E> {
    public MyLinkedBlockingDeque() {
        super();
    }

    public MyLinkedBlockingDeque(int i) {
        super(i);
    }

    public boolean add(E e) {
//        System.out.println("添加"+e.toString());
        super.poll();
//        System.out.println("移除："+poll);
        addLast(e);
        return true;
    }
}
